package co.com.inventarios.modelo;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * MngdocId entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Embeddable
public class MngdocId implements java.io.Serializable {

	// Fields

	private String docempresa;
	private String docclase;
	private String docvinkey;
	private String doctipo;
	private Double docnumero;

	// Constructors

	/** default constructor */
	public MngdocId() {
	}

	/** full constructor */
	public MngdocId(String docempresa, String docclase, String docvinkey,
			String doctipo, Double docnumero) {
		this.docempresa = docempresa;
		this.docclase = docclase;
		this.docvinkey = docvinkey;
		this.doctipo = doctipo;
		this.docnumero = docnumero;
	}

	// Property accessors

	@Column(name = "DOCEMPRESA", unique = false, nullable = false, insertable = true, updatable = true, length = 3)
	public String getDocempresa() {
		return this.docempresa;
	}

	public void setDocempresa(String docempresa) {
		this.docempresa = docempresa;
	}

	@Column(name = "DOCCLASE", unique = false, nullable = false, insertable = true, updatable = true, length = 4)
	public String getDocclase() {
		return this.docclase;
	}

	public void setDocclase(String docclase) {
		this.docclase = docclase;
	}

	@Column(name = "DOCVINKEY", unique = false, nullable = false, insertable = true, updatable = true, length = 15)
	public String getDocvinkey() {
		return this.docvinkey;
	}

	public void setDocvinkey(String docvinkey) {
		this.docvinkey = docvinkey;
	}

	@Column(name = "DOCTIPO", unique = false, nullable = false, insertable = true, updatable = true, length = 4)
	public String getDoctipo() {
		return this.doctipo;
	}

	public void setDoctipo(String doctipo) {
		this.doctipo = doctipo;
	}

	@Column(name = "DOCNUMERO", unique = false, nullable = false, insertable = true, updatable = true, precision = 13, scale = 1)
	public Double getDocnumero() {
		return this.docnumero;
	}

	public void setDocnumero(Double docnumero) {
		this.docnumero = docnumero;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof MngdocId))
			return false;
		MngdocId castOther = (MngdocId) other;

		return ((this.getDocempresa() == castOther.getDocempresa()) || (this
				.getDocempresa() != null
				&& castOther.getDocempresa() != null && this.getDocempresa()
				.equals(castOther.getDocempresa())))
				&& ((this.getDocclase() == castOther.getDocclase()) || (this
						.getDocclase() != null
						&& castOther.getDocclase() != null && this
						.getDocclase().equals(castOther.getDocclase())))
				&& ((this.getDocvinkey() == castOther.getDocvinkey()) || (this
						.getDocvinkey() != null
						&& castOther.getDocvinkey() != null && this
						.getDocvinkey().equals(castOther.getDocvinkey())))
				&& ((this.getDoctipo() == castOther.getDoctipo()) || (this
						.getDoctipo() != null
						&& castOther.getDoctipo() != null && this.getDoctipo()
						.equals(castOther.getDoctipo())))
				&& ((this.getDocnumero() == castOther.getDocnumero()) || (this
						.getDocnumero() != null
						&& castOther.getDocnumero() != null && this
						.getDocnumero().equals(castOther.getDocnumero())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getDocempresa() == null ? 0 : this.getDocempresa()
						.hashCode());
		result = 37 * result
				+ (getDocclase() == null ? 0 : this.getDocclase().hashCode());
		result = 37 * result
				+ (getDocvinkey() == null ? 0 : this.getDocvinkey().hashCode());
		result = 37 * result
				+ (getDoctipo() == null ? 0 : this.getDoctipo().hashCode());
		result = 37 * result
				+ (getDocnumero() == null ? 0 : this.getDocnumero().hashCode());
		return result;
	}

}